{include file="public/head" /}
<style>.am-popup{height: 350px}.admin-main{padding-top:0}</style>
</head>
<body>
<div class="am-cf admin-main">
    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">创建课程</strong></div>
            </div>
            <div class="am-u-md-10">
                <form method="post" class="am-form" action="/user/Course/createPost">
                    <strong>*</strong><label>课程名称</label>
                    <input type="text" name="name">
                    <strong>*</strong><label>类别</label>
                    <select name="type">
                        <option value="" hidden>请选择类别</option>
                        {volist name="typeList" id="vo"}
                        <option value="{$vo.id}">{$vo.name}</option>
                        {/volist}
                    </select>
                    <strong>*</strong><label>上课日</label>
                    <select name="day">
                        <option value="" hidden>请选择类别</option>
                        <option value="一">一</option>
                        <option value="二">二</option>
                        <option value="三">三</option>
                        <option value="四">四</option>
                        <option value="五">五</option>
                    </select>
                    <strong>*</strong><label>上课地点(教室)</label>
                    <input type="text" name="classroom">
                    {php}$lesson = [1,2,3,4,5,6,7,8,9,10,11,12];{/php}
                    <strong>*</strong><label>开始节数</label>
                    <select name="begin_lesson">
                        <option value="" hidden>请选择</option>
                        {foreach name="lesson" item="vo"}
                            <option value="{$vo}">{$vo}</option>
                        {/foreach}
                    </select>
                    <strong>*</strong><label>结束节数</label>
                    <select name="end_lesson">
                        <option value="" hidden>请选择</option>
                        {foreach name="lesson" item="vo"}
                        <option value="{$vo}">{$vo}</option>
                        {/foreach}
                    </select>
                    <strong>*</strong><label>限选人数</label>
                    <input type="number" name="limit_student_count">
                    <div class="am-cf">
                        <a class="am-btn am-btn-primary am-btn-sm am-fl ajax-submit" href="javascript:;">提交</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- content end -->
<!--模态框-->
<div class="am-modal am-modal-alert" tabindex="-1" id="alert">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">提示</div>
        <div class="am-modal-bd">
            现在不是开课的时间!
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn">确定</span>
        </div>
    </div>
</div>
</div>
<script src="__STATIC__/js/ajax_form.js"></script>
<script>
    $(function(){
        var userType = {$type};
        if(userType==2){
            $.get("/user/Index/checkCreateStatus",{},function(res){
                if(res.code==0){
                    $('#alert').modal();
                }
            },"json");
        }
        $('#alert').on('closed.modal.amui', function(){
            window.location.href = '/user/Course/myCreate';
        });
    });
</script>
</body>
</html>
